package com.linchong.xshop.util;

/**
 * @Title: PageCalculator
 * @Author linchong
 * @Desc: 处理分页
 * @Email:littlexbear@163.com
 * @date 2018/8/4 23:52
 **/
public class PageCalculator {

    /**
     * 从哪里取
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public static int calculateRowIndex(int pageIndex,int pageSize){
        return (pageIndex > 0) ? (pageIndex - 1) * pageSize : 0;
    }
}
